/*
 * aqua-firefox-theme
 * custom-icons.css
 *
 * Copyright (c) 2019 Payson Wallach
 *
 * Released under the terms of the GNU General Public License, version 3
 * (https://gnu.org/licenses/gpl.html)
 */
@namespace xul "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";

/* popovers subview menu arrow */
.PanelUI-subView .subviewbutton-nav::after {
    content: "" !important;
    background: url("../icons/pan-start-symbolic.svg");
    background-size: contain;
    height: 16px;
    width: 16px;
    margin-top: -2px !important;
}

/* popovers subview back button */
.subviewbutton-back {
    list-style-image: url("../icons/pan-start-symbolic.svg") !important;
}

/* sub-menu arrow */
.menu-right {
    -moz-appearance: none !important;
    list-style-image: url("../icons/pan-end-symbolic.svg") !important;
    width: 16px !important;
    height: 16px !important;
}

menu[disabled]>.menu-right {
    opacity: 0.3;
}

@media (prefers-color-scheme: light) {

    menu:not([disabled]):hover>.menu-right,
    menu[open]>.menu-right {
        filter: invert(100%) brightness(200%);
    }
}

/* arrow-down buttons */
.expander-down>.button-box,
#sidebar-switcher-arrow,
#viewButton .button-menu-dropmarker {
    -moz-appearance: none !important;
    list-style-image: url("../icons/pan-down-symbolic.svg") !important;
    width: 16px !important;
    height: 16px !important;
}

.menulist-label-box:after {
    content: url("../icons/pan-down-symbolic.svg") !important;
}

/* tree views */
treechildren::-moz-tree-twisty {
    list-style-image: url("../icons/pan-down-symbolic.svg") !important;
    width: 16px !important;
    height: 16px !important;
}

treechildren::-moz-tree-twisty(open) {
    list-style-image: url("../icons/pan-end-symbolic.svg") !important;
}

treechildren::-moz-tree-twisty(selected, focus) {
    list-style-image: url("../icons/pan-down-symbolic-light.svg") !important;
}

treechildren::-moz-tree-twisty(selected, focus, open) {
    list-style-image: url("../icons/pan-end-symbolic-light.svg") !important;
}

.sidebar-panel[lwt-sidebar-brighttext] .sidebar-placesTreechildren::-moz-tree-twisty {
    list-style-image: url("../icons/pan-down-symbolic-light.svg") !important;
}

.sidebar-panel[lwt-sidebar-brighttext] .sidebar-placesTreechildren::-moz-tree-twisty(open) {
    list-style-image: url("../icons/pan-end-symbolic-light.svg") !important;
}

/* arrow-up buttons */
.expander-up>.button-box {
    -moz-appearance: none !important;
    list-style-image: url("../icons/pan-up-symbolic.svg") !important;
    width: 16px !important;
    height: 16px !important;
}

/* search entries */
#urlbar[pageproxystate="invalid"]>#identity-box>#identity-icon,
.searchbar-search-icon,
#search-box .textbox-search-sign {
    list-style-image: url(../icons/edit-find-symbolic.svg) !important;
    opacity: 0.7 !important;
}

#search-box .textbox-search-sign {
    width: 16px !important;
    margin: 2px 0;
}

/* private browsing button */
#privatebrowsing-button .toolbarbutton-icon {
    list-style-image: url("../icons/user-not-tracked.svg") !important;
}

/* invert icon colors in dark variant */
@media (prefers-color-scheme: dark) {

    #nav-bar #privatebrowsing-button .toolbarbutton-icon,
    .PanelUI-subView .subviewbutton-nav::after,
    .subviewbutton-back .toolbarbutton-icon,
    .menu-right,
    #urlbar[pageproxystate="invalid"]>#identity-box>#identity-icon,
    .searchbar-search-icon,
    #search-box .textbox-search-sign,
    .menulist-label-box:after,
    .expander-down image,
    .expander-up image,
    #sidebar-switcher-arrow,
    #viewButton .button-menu-dropmarker {
        filter: invert(100%) brightness(200%);
    }

    /* tree views */
    treechildren::-moz-tree-twisty {
        list-style-image: url("../icons/pan-down-symbolic-light.svg") !important;
    }

    treechildren::-moz-tree-twisty(open) {
        list-style-image: url("../icons/pan-end-symbolic-light.svg") !important;
    }

    /* fix for extensions icons */
    .webextension-browser-action {
        list-style-image: var(--webextension-menupanel-image-light, inherit) !important;
    }
}

/* back button */
#back-button .toolbarbutton-icon {
    filter: var(--aqua-icons-hack-filter);
    list-style-image: url("../icons/chevron-left.svg") !important;
}

/* forward button */
#forward-button .toolbarbutton-icon {
    filter: var(--aqua-icons-hack-filter);
    list-style-image: url("../icons/chevron-right.svg") !important;
}